package problem58;

//58. 最后一个单词的长度
//https://leetcode.cn/problems/length-of-last-word/

class Solution {
    public int lengthOfLastWord(String s) {
        s = s.trim();
        return s.length() - s.lastIndexOf(" ")-1;
    }
}